package com.myk.game.heroscuffle.heroes;

import com.myk.game.heroscuffle.game.Element;
import com.myk.game.heroscuffle.game.Hero;
import com.myk.game.heroscuffle.game.Skill;
import com.myk.game.heroscuffle.skills.Skill_GuanRi;
import com.myk.game.heroscuffle.skills.Skill_LiuXing;
import com.myk.game.heroscuffle.utils.RdmPropUtil;

public class Hero_MoYan extends Hero {

    public Hero_MoYan() {
        super("魔焱",
                "拥有多个强大的伤害性技能。",
                Element.FLAME,
                1200, 135, 46,
                new Skill_LiuXing(), new Skill_GuanRi());
    }

    @Override
    public void onAutoSelectAction() {
        Skill liuxing = getUsableSkill(Skill_LiuXing.class);
        Skill guanri = getUsableSkill(Skill_GuanRi.class);
        boolean isLowHp = hp < (HP / 3f);
        if (isLowHp) { //低生命值更愿意用贯日
            if (guanri != null) {
                if (liuxing != null) {
                    if (RdmPropUtil.bingo(8, 13)) {
                        if (RdmPropUtil.bingo(11, 13)) {
                            useSkill(guanri);
                        }
                        else {
                            useSkill(liuxing);
                        }
                    }
                    else {
                        super.onAutoSelectAction();
                    }
                }
                else {
                    if (RdmPropUtil.bingo(9, 13)) {
                        useSkill(guanri);
                    }
                    else {
                        super.onAutoSelectAction();
                    }
                }
            }
            else {
                if (liuxing != null) {
                    if (RdmPropUtil.bingo(11, 13)) {
                        super.onAutoSelectAction();
                    }
                    else {
                        useSkill(liuxing);
                    }
                }
                else {
                    super.onAutoSelectAction();
                }
            }
        }
        else { //高生命值更愿意用流星
            if (liuxing != null) {
                if (guanri != null) {
                    if (RdmPropUtil.bingo(8, 13)) {
                        if (RdmPropUtil.bingo(11, 13)) {
                            useSkill(liuxing);
                        }
                        else {
                            useSkill(guanri);
                        }
                    }
                    else {
                        super.onAutoSelectAction();
                    }
                }
                else {
                    if (RdmPropUtil.bingo(8, 13)) {
                        useSkill(liuxing);
                    }
                    else {
                        super.onAutoSelectAction();
                    }
                }
            }
            else {
                if (guanri != null) {
                    if (RdmPropUtil.bingo(11, 13)) {
                        super.onAutoSelectAction();
                    }
                    else {
                        useSkill(guanri);
                    }
                }
                else {
                    super.onAutoSelectAction();
                }
            }
        }
    }
}
